<%@ page import="com.apexedu.portal.constant.Constants" %>
<%@ page import="java.util.Random" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    request.setAttribute("basePath", request.getContextPath());
    Random rand =new Random();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title><%=Constants.ProjectInfo.PROJECT_NAME%>
    </title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="${basePath}/resources/css/mh.shd.css" rel="stylesheet">
    <link href="${basePath}/resources/css/mh.shd.css" rel="stylesheet">
    <script type="text/javascript" src="${basePath}/clientui/js/jquery-1.4.js"></script>
    <script src="${basePath}/resources/js/mh.shd.index.js" type="text/javascript"></script>
    <link href="${basePath}/resources/css/portal.server.detail.css" rel="stylesheet" type="text/css"/>
    <script src="${basePath}/resources/js/portal.server.detail.js" type="text/javascript"></script>
    <style type="text/css">
        #contentSub .service_detail_title {
            height: 40px;
            line-height: 40px;
            font-size: 20px;
            text-indent: 10px;
            color: #959698;
            text-align: left;
            margin-bottom: 20px;
            font-weight: normal;
        }
    </style>
</head>
<body>
<div id="main">
    <jsp:include page="../shd/left.jsp"/>
    <div id="right">
        <jsp:include page="../shd/head.jsp"/>
        <div id="contentSub">
            <div class="service_detail_intro">
                <div class="service_detail_title">服务内容介绍</div>
                <div class="service_detail_icon">
                    <img src="<%=request.getContextPath()%>/resources/images/icons/basis/${tsysmenu.tb}"
                         onError="this.src='${basePath}/resources/images/icons/basis/icon_<%=rand.nextInt(80)+10%>.png'"/>
                    <a href="${tsysmenu.menupath}" target="_blank" class="see">在线办理</a>
                </div>
                <div class="service_detail_info">
                    <div class="service_detail_name" menuid="${tsysmenu.menuid}" username="${userid}"
                         menuname="${tsysmenu.menuname}">
                        ${tsysmenu.menuname}
                    </div>
                    <div class="service_detail_des">
                        <c:out value="${tsysmenu.des}" escapeXml="false"/>
                    </div>
                </div>
            </div>
            <div class="service_detail_rule">
                <div class="service_detail_rule2">
                <div class="service_detail_title">规则说明</div>
                <c:choose>
                    <c:when test="${regus !=null && fn:length(regus)!=0}">
                        <c:forEach items="${regus}" var="entity">
                            <div style="border: 1px solid #ccc;margin-top:10px; padding:10px;">
                                <div>
                                    <span class="service_detail_ruletitle">业务规则：</span>
                                    <span class="service_detail_ruletext">${entity.bt}</span>
                                </div>
                                <div>
                                    <span class="service_detail_ruletitle">原始需求：</span>
                                    <span class="service_detail_ruletext">${entity.ysxqfjsm}</span>
                                    <a href="${aucUrl}${entity.ysxqfjurl}">点击下载</a>
                                </div>
                                <div>
                                    <span class="service_detail_ruletitle">规章制度：</span>
                                    <span class="service_detail_ruletext">${entity.gzzdfjsm}</span>
                                    <a href="${aucUrl}${entity.gzzdfjurl}">点击下载</a>
                                </div>
                                <div>
                                    <span class="service_detail_ruletitle">涉及岗位：</span>
                                    <span class="service_detail_ruletext">${entity.sjgw}</span>
                                </div>
                                <div>
                                    <span class="service_detail_ruletitle">规则描述：</span>
                                    <span class="service_detail_ruletext">${entity.gzms}</span>
                                </div>
                                <div>
                                    <span class="service_detail_ruletitle">规则配置：</span>
										<span class="service_detail_ruletext">
											<a href="${aucUrl}${entity.fjdz}">点击下载</a>
										</span>
                                </div>
                            </div>
                        </c:forEach>
                    </c:when>
                    <c:otherwise>
                        暂无规则说明，请联系网站管理员添加。
                    </c:otherwise>
                </c:choose>
                </div>
            </div>
            <div class="service_detail_feedback">
                <div class="service_detail_title">问题反馈</div>
                <span class="addfeedback">添加问题</span>

                <div class="addfeedback_box" style="display:none;">
                    问题类型：
                    <c:forEach items="${protypes}" var="t" varStatus="status">
                        <input type="radio" name="tid" class="tid" value="${t.wid}" <c:if test="${status.index == 0}">checked</c:if>>${t.name}
                    </c:forEach>
                    <div>
                        标题：<input name="pproblem" id="pproblem"
                                  style="width:400px;height:25px;line-hight:25px;"/><br/>
                    </div>
                    <span style="vertical-align: top;">内容：</span><textarea id="pcontent" name="pcontent"
                                                                           maxlength="200" class="input-xxlarge"
                                                                           rows="10" cols="100"></textarea>

                    <div class="addfeedback_btnbox" style="margin-left:30px;">
                        <input type="button" class="addfeedback_sub" value="提交"/> <input type="button"
                                                                                         class="addfeedback_cancel"
                                                                                         value="取消"/>
                    </div>
                </div>
                <c:choose>
                    <c:when test="${empty pros}">
                        <p style="clear: both;" class="zwpl">暂无评论</p>
                    </c:when>
                    <c:otherwise>
                        <c:forEach items="${pros}" var="p" varStatus="st">
                            <div class="feedback_content">
                                <div class="feedback_content_title">${st.count},${p.pproblem}
                                    <span style="padding-left: 10px;color:#3880FF;">
                                        <c:if test="${userid=='admin'}">
                                            <c:if test="${p.state=='1'}">
                                                <span style="padding-left: 5px;">(发布)</span>
                                            </c:if>
                                            <c:if test="${p.state=='0'}">
                                                <span style="padding-left: 5px;">(未发布)</span>
                                            </c:if>
                                        </c:if>
                                    </span>
                                </div>

                                <div class="feedback_content_text">${p.pcontent}</div>
                                <span class="name">反馈人：${p.puser} </span>
                                <span class="time">反馈时间：${p.ptime} </span>

                                <span class="addreplys" name="${p.wid}">回复(${fn:length(p.anspros)})</span>
                                <span class="addcomments" name="${p.wid}">评论(${fn:length(p.discusss)})</span>
                                <c:if test="${userid=='admin'}">
                                    <span class="enable"  wid="${p.wid}">发布</span>
                                    <span class="disable" wid="${p.wid}">未发布</span>
                                </c:if>
                                <c:if test="${userid==p.puser||userid=='admin'}">
                                    <span class="delete" wid="${p.wid}">删除</span>
                                </c:if>
                                <div class="comments" style="display:none">
                                    <div class="title">添加评论</div>
                                    <div class="addcomments_box">
                                        <input type="hidden" name="duser" value="${userid}"/>
                                        <input type="hidden" name="pwid" value="${p.wid}"/>
                                        <span style="vertical-align: top;">内容：</span><textarea
                                            id="addcomments_content${p.wid}" class="addcomments_content" rows="10"
                                            cols="100" name="dcontent"></textarea>

                                        <div class="addcomments_btnbox" style="margin-left:30px;">
                                            <input type="button" class="addcomments_sub" value="提交"/>
                                        </div>
                                    </div>
                                    <div class="title">全部评论</div>
                                    <c:choose>
                                        <c:when test="${empty p.discusss}">
                                            暂无评论！
                                        </c:when>
                                        <c:otherwise>
                                            <c:forEach items="${p.discusss}" var="d">
                                                <div class="comments_box">
                                                    <span class="name">${d.duser}</span>：
                                                    <div class="comments_content">${d.dcontent}</div>
                                                    <span class="time">发表于${d.dtime}</span>
                                                    <c:if test="${userid==d.duser||userid=='admin'}">
                                                        <span wid="${d.wid}" class="deleteDis " >删除</span>
                                                    </c:if>
                                                </div>
                                            </c:forEach>
                                        </c:otherwise>
                                    </c:choose>

                                </div>

                                <div class="replys" style="display:none">

                                    <c:if test="${'admin'== userid}">
                                        <div class="title">添加回复</div>
                                        <div class="addreplys_box">
                                            <span style="vertical-align: top;">内容：</span><textarea
                                                id="addreplys_content${p.wid}" class="addreplys_content" rows="10"
                                                cols="100" name="pcontent"></textarea>

                                            <div class="addreplys_btnbox" style="margin-left:30px;">
                                                <input type="button" class="addreplys_sub" value="提交"/>
                                            </div>
                                        </div>
                                    </c:if>
                                    <div class="title">全部回复</div>
                                    <c:choose>
                                        <c:when test="${empty p.anspros}">
                                            暂无回复！
                                        </c:when>
                                        <c:otherwise>
                                            <c:forEach items="${p.anspros}" var="answer">
                                                <div class="replys_box">
                                                    <span class="name">${answer.puser}</span>：
                                                    <div class="replys_content">${answer.pcontent}</div>
                                                    <span class="time">发表于${answer.ptime}</span>
                                                    <c:if test="${userid==answer.puser||userid=='admin'}">
                                                        <span wid="${answer.wid}" class="delanswer">删除</span>
                                                    </c:if>
                                                </div>
                                            </c:forEach>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                            </div>
                        </c:forEach>
                    </c:otherwise>
                </c:choose>
            </div>
        </div>
        <%--<jsp:include page="../shd/foot.jsp"/>--%>
    </div>
</div>
</body>
</html>
